using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class HR_EmployeeMap : EntityTypeConfiguration<HR_Employee>
    {
        public HR_EmployeeMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Main_Number)
                .HasMaxLength(50);

            this.Property(t => t.Previous_Number)
                .HasMaxLength(50);

            this.Property(t => t.Accounting_Number)
                .HasMaxLength(50);

            this.Property(t => t.Insurance_Number)
                .HasMaxLength(50);

            this.Property(t => t.Attendance_Card_Number)
                .HasMaxLength(50);

            this.Property(t => t.First)
                .HasMaxLength(50);

            this.Property(t => t.Father)
                .HasMaxLength(50);

            this.Property(t => t.Grand_Father)
                .HasMaxLength(50);

            this.Property(t => t.Family)
                .HasMaxLength(50);

            this.Property(t => t.Place_of_Birth)
                .HasMaxLength(50);

            this.Property(t => t.Gender)
                .HasMaxLength(10);

            this.Property(t => t.Address)
                .HasMaxLength(50);

            this.Property(t => t.Phone)
                .HasMaxLength(50);

            this.Property(t => t.Mobile)
                .HasMaxLength(50);

            this.Property(t => t.FAX)
                .HasMaxLength(50);

            this.Property(t => t.Email)
                .HasMaxLength(50);

            this.Property(t => t.POBOX)
                .HasMaxLength(50);

            this.Property(t => t.ZIP)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Blood_Group)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Bank_Account_Number)
                .HasMaxLength(50);

            this.Property(t => t.Bank)
                .HasMaxLength(50);

            this.Property(t => t.Driving_License)
                .HasMaxLength(50);

            this.Property(t => t.Origin_Country_Address)
                .HasMaxLength(50);

            this.Property(t => t.Origin_Country_Phone)
                .HasMaxLength(50);

            this.Property(t => t.Residence_Number)
                .HasMaxLength(50);

            this.Property(t => t.Residence_Issue_Place)
                .HasMaxLength(50);

            this.Property(t => t.Passport_Number)
                .HasMaxLength(50);

            this.Property(t => t.Passport_Issue_Place)
                .HasMaxLength(50);

            this.Property(t => t.Current_sponsor_name)
                .HasMaxLength(50);

            this.Property(t => t.Previous_sponsor_name)
                .HasMaxLength(50);

            this.Property(t => t.Previous_sponsor_Phone)
                .HasMaxLength(50);

            this.Property(t => t.Previous_sponsor_Computer_number)
                .HasMaxLength(50);

            this.Property(t => t.Spouse_name)
                .HasMaxLength(50);

            this.Property(t => t.Date_of_resignation)
                .IsFixedLength()
                .HasMaxLength(10);

            this.Property(t => t.Resignation_reason)
                .HasMaxLength(50);

            this.Property(t => t.Status)
                .HasMaxLength(2);

            // Table & Column Mappings
            this.ToTable("HR_Employee");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.Main_Number).HasColumnName("Main_Number");
            this.Property(t => t.Previous_Number).HasColumnName("Previous_Number");
            this.Property(t => t.Accounting_Number).HasColumnName("Accounting_Number");
            this.Property(t => t.Insurance_Number).HasColumnName("Insurance_Number");
            this.Property(t => t.Attendance_Card_Number).HasColumnName("Attendance_Card_Number");
            this.Property(t => t.First).HasColumnName("First");
            this.Property(t => t.Father).HasColumnName("Father");
            this.Property(t => t.Grand_Father).HasColumnName("Grand_Father");
            this.Property(t => t.Family).HasColumnName("Family");
            this.Property(t => t.Date_of_Birth).HasColumnName("Date_of_Birth");
            this.Property(t => t.Place_of_Birth).HasColumnName("Place_of_Birth");
            this.Property(t => t.Gender).HasColumnName("Gender");
            this.Property(t => t.Nationality).HasColumnName("Nationality");
            this.Property(t => t.Religion).HasColumnName("Religion");
            this.Property(t => t.Address).HasColumnName("Address");
            this.Property(t => t.Phone).HasColumnName("Phone");
            this.Property(t => t.Mobile).HasColumnName("Mobile");
            this.Property(t => t.FAX).HasColumnName("FAX");
            this.Property(t => t.Email).HasColumnName("Email");
            this.Property(t => t.POBOX).HasColumnName("POBOX");
            this.Property(t => t.ZIP).HasColumnName("ZIP");
            this.Property(t => t.Blood_Group).HasColumnName("Blood_Group");
            this.Property(t => t.Bank_Account_Number).HasColumnName("Bank_Account_Number");
            this.Property(t => t.Bank).HasColumnName("Bank");
            this.Property(t => t.Driving_License).HasColumnName("Driving_License");
            this.Property(t => t.Insured).HasColumnName("Insured");
            this.Property(t => t.Liable_To_Health_Insurance).HasColumnName("Liable_To_Health_Insurance");
            this.Property(t => t.Impaired).HasColumnName("Impaired");
            this.Property(t => t.Origin_Country_Address).HasColumnName("Origin_Country_Address");
            this.Property(t => t.Origin_Country_Phone).HasColumnName("Origin_Country_Phone");
            this.Property(t => t.Residence_Number).HasColumnName("Residence_Number");
            this.Property(t => t.Residence_Issue_Place).HasColumnName("Residence_Issue_Place");
            this.Property(t => t.Residence_Expiry_Date).HasColumnName("Residence_Expiry_Date");
            this.Property(t => t.Passport_Number).HasColumnName("Passport_Number");
            this.Property(t => t.Passport_Issue_Place).HasColumnName("Passport_Issue_Place");
            this.Property(t => t.Passport_Expiry_date).HasColumnName("Passport_Expiry_date");
            this.Property(t => t.Current_sponsor_name).HasColumnName("Current_sponsor_name");
            this.Property(t => t.Previous_sponsor_name).HasColumnName("Previous_sponsor_name");
            this.Property(t => t.Previous_sponsor_Phone).HasColumnName("Previous_sponsor_Phone");
            this.Property(t => t.Previous_sponsor_Computer_number).HasColumnName("Previous_sponsor_Computer_number");
            this.Property(t => t.Spouse_name).HasColumnName("Spouse_name");
            this.Property(t => t.Children_number).HasColumnName("Children_number");
            this.Property(t => t.Resigned).HasColumnName("Resigned");
            this.Property(t => t.Date_of_resignation).HasColumnName("Date_of_resignation");
            this.Property(t => t.Date_of_Payments).HasColumnName("Date_of_Payments");
            this.Property(t => t.Resignation_reason).HasColumnName("Resignation_reason");
            this.Property(t => t.Citizen).HasColumnName("Citizen");
            this.Property(t => t.SPonsored_by_others).HasColumnName("SPonsored_by_others");
            this.Property(t => t.Status).HasColumnName("Status");
            this.Property(t => t.Category).HasColumnName("Category");
            this.Property(t => t.Note).HasColumnName("Note");
            this.Property(t => t.EmployeeID).HasColumnName("EmployeeID");
            this.Property(t => t.HR_EMP_Position).HasColumnName("HR_EMP_Position");
            this.Property(t => t.HR_EMP_Department).HasColumnName("HR_EMP_Department");
            this.Property(t => t.HR_EMP_Branch).HasColumnName("HR_EMP_Branch");
            this.Property(t => t.HR_EMP_EOS_Type).HasColumnName("HR_EMP_EOS_Type");
            this.Property(t => t.HR_EMP_EOS_LastDay).HasColumnName("HR_EMP_EOS_LastDay");
            this.Property(t => t.HR_EMP_EOS_BasicSalary).HasColumnName("HR_EMP_EOS_BasicSalary");
            this.Property(t => t.HR_EMP_EOS_Years).HasColumnName("HR_EMP_EOS_Years");
            this.Property(t => t.HR_EMP_EOS_MonthForYear).HasColumnName("HR_EMP_EOS_MonthForYear");
            this.Property(t => t.HR_EMP_EOS_AMOUNT).HasColumnName("HR_EMP_EOS_AMOUNT");
            this.Property(t => t.HR_EMP_VacDue).HasColumnName("HR_EMP_VacDue");
            this.Property(t => t.HR_EMP_VacTaken).HasColumnName("HR_EMP_VacTaken");
            this.Property(t => t.HR_EMP_VacRemain).HasColumnName("HR_EMP_VacRemain");
            this.Property(t => t.HR_EMP_PayPerDay).HasColumnName("HR_EMP_PayPerDay");
            this.Property(t => t.HR_EMP_VacPerYear).HasColumnName("HR_EMP_VacPerYear");
        }
    }
}
